package xyz.zhno.adapter;

/**
 * 模拟客户端: 手机
 * @author zh_o
 * @date 2020-11-15
 */
public class Phone {

    public void charging(Voltage5V adapter) {
        if (adapter.output5V().equals(5)) {
            System.out.println("充电......");
        } else {
            System.out.println("电压异常");
        }
    }

    public static void main(String[] args) {
        Phone phone = new Phone();
        Voltage220V voltage220V = new Voltage220V();
        Adapter adapter = new Adapter(voltage220V);
        phone.charging(adapter);
    }

}
